package dao

import (
	"fmt"
	"github.com/jinzhu/gorm"
)

type ManualCatalogRm struct {
	Id              int64  `gorm:"primaryKey"`
	CatalogUrl      string `gorm:"column:catalog_url;type:varchar(255)"`
	CatalogSpareUrl string `gorm:"column:catalog_spare_url;type:varchar(255)"`
	CatalogDesc     string `gorm:"column:catalog_desc;type:varchar(255)"`
	CatalogNo       string `gorm:"column:catalog_no;type:varchar(255)"`
	ModelId         int64  `gorm:"column:model_id;type:bigint(20)"`
}

type ManualCatalogRmDao struct {
	db *gorm.DB
}

func NewManualCatalogRmDao(db *gorm.DB) *ManualCatalogRmDao {
	return &ManualCatalogRmDao{db: db}
}

func (f *ManualCatalogRmDao) CreateManualCatalogRm(param *ManualCatalogRm) int64 {
	err := f.db.Create(param).Error
	if err != nil {
		fmt.Print("写入 ManualCatalogRm db错误", err)
	}
	return param.Id
}
